package com.mind.adjust.service.impl;

import com.mind.customer.mapper.AjBasicNoMaterialmappingMapper;
import com.mind.system.domain.AjBasicNoMaterialmapping;
import com.mind.adjust.service.AjBasicNoMaterialmappingService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


/**
 * (AjBasicNoMaterialmapping)表服务实现类
 *
 * @author makejava
 * @since 2024-12-02 13:40:25
 */
@Service("basicNoMaterialmappingService")
public class AjBasicNoMaterialmappingServiceImpl implements AjBasicNoMaterialmappingService {
    @Autowired
    private AjBasicNoMaterialmappingMapper basicNoMaterialmappingMapper;

    /**
     * 查询信息集合
     * 
     * @param basicNoMaterialmapping 信息
     * @return 信息集合
     */
    @Override
    public List<AjBasicNoMaterialmapping> selectBasicNoMaterialmappingList(AjBasicNoMaterialmapping basicNoMaterialmapping)
    {
        return basicNoMaterialmappingMapper.selectBasicNoMaterialmappingList(basicNoMaterialmapping);
    }

    /**
     * 通过ID查询信息
     * 
     * @param basicNoMaterialmappingId ID
     * @return 角色对象信息
     */
    @Override
    public AjBasicNoMaterialmapping selectBasicNoMaterialmappingById(Long basicNoMaterialmappingId)
    {
        return basicNoMaterialmappingMapper.selectBasicNoMaterialmappingById(basicNoMaterialmappingId);
    }

    /**
     * 删除信息
     * 
     * @param basicNoMaterialmappingId ID
     * @return 结果
     */
    @Override
    public int deleteBasicNoMaterialmappingById(Long basicNoMaterialmappingId)
    {
        return basicNoMaterialmappingMapper.deleteBasicNoMaterialmappingById(basicNoMaterialmappingId);
    }

    /**
     * 批量删除信息
     * 
     * @param basicNoMaterialmappingIds 需要删除的ID
     * @return 结果
     */
    @Override
    public int deleteBasicNoMaterialmappingByIds(Long[] basicNoMaterialmappingIds)
    {
        return basicNoMaterialmappingMapper.deleteBasicNoMaterialmappingByIds(basicNoMaterialmappingIds);
    }

    /**
     * 新增保存信息
     * 
     * @param basicNoMaterialmapping 信息
     * @return 结果
     */
    @Override
    public int insertBasicNoMaterialmapping(AjBasicNoMaterialmapping basicNoMaterialmapping)
    {
        return basicNoMaterialmappingMapper.insertBasicNoMaterialmapping(basicNoMaterialmapping);
    }

    /**
     * 修改保存信息
     * 
     * @param basicNoMaterialmapping 信息
     * @return 结果
     */
    @Override
    public int updateBasicNoMaterialmapping(AjBasicNoMaterialmapping basicNoMaterialmapping)
    {
        return basicNoMaterialmappingMapper.updateBasicNoMaterialmapping(basicNoMaterialmapping);
    }
    
    /**
     * 批量插入
     *
     * @param basicNoMaterialmappingList 附件类型信息
     * @return 结果
     */
    @Override
    public int batchInsert(List<AjBasicNoMaterialmapping> basicNoMaterialmappingList) {
        int size = 0;
        for(AjBasicNoMaterialmapping basicNoMaterialmapping: basicNoMaterialmappingList) {
//            if (basicNoMaterialmappingMapper.selectBasicNoMaterialmappingByName(basicNoMaterialmapping.getName()) == null){
//                basicNoMaterialmappingMapper.insertBasicNoMaterialmapping(basicNoMaterialmapping);
//                size ++;
//            }
        }
        return size;
    }
}
